package com.demo.thread.server.impl;

import com.demo.thread.bean.ResultBean;
import com.demo.thread.server.MyTask;

import java.util.Map;

/**
 * @author zx
 * 测试类
 */
public class TaskImpl implements MyTask<ResultBean<String>,Integer> {
    /**
     * 重写其中的执行方法类
     * @param e   传入的对象
     * @param params
     * @return
     */
    @Override
    public ResultBean<String> execute(Integer e, Map<String, Object> params) {
        int addNum = Integer.valueOf(String.valueOf(params.get("addNum")));
        e = e + addNum;
        ResultBean<String> resultBean = ResultBean.newInstance();
        resultBean.setData(e.toString());
        return resultBean;
    }
}
